package org.meproj.communication.bean;

public enum Roles {

	NULL_ADAPTER(0),
	EARLY_ADAPTER(1),
	EARLY_MAJORITY(2),
	LATE_MAJORITY(3),
	LAGGARD(4);
	
	
	private int degree;
	Roles(int degree) {
		this.degree = degree;
	}
	public int getDegree() {
		return degree;
	}
	
	public void setDegree(int degree) {
		this.degree = degree;
	}
	
	public int minus() {
	   
		if(this == Roles.LAGGARD) {
			return Roles.LAGGARD.getDegree();
			
		} else if(this == Roles.NULL_ADAPTER) {
			return Roles.NULL_ADAPTER.getDegree();
			
		} else {
			return this.getDegree() - 1 < 0 ? 0: this.getDegree() - 1;
		}
	}
}
